package com.bella.api.configuration.adviser;


import com.bella.api.configuration.BusinessException;
import com.bella.api.utils.ApiResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@RestControllerAdvice
public class GloabalExceptionHandler {

    private org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(GloabalExceptionHandler.class);


    @ExceptionHandler(value = { BusinessException.class })
    public ApiResponse<String> handleBusinessException(BusinessException e) {

        return new ApiResponse<>(e.getCode(),e.getMsg());
    }
}
